#!/usr/bin/perl -w

#####################################################################
# Program Variables - Go see the central config.pm!
#####################################################################
use FindBin qw($Bin);
use lib "$Bin";
use config;
use layout;

#####################################################################
# Program Modules
#####################################################################
# CGI Modules
use CGI;
use CGI::Carp;
use CGI::Pretty;

#####################################################################
# Program Start
#####################################################################
my $cgi = new CGI;

my $pagetitle = &read_config_option("tank_name") . " Index Page";

my @links;

# Check to see if we are using the apex.
if (&read_config_option("controller_type") eq "Apex") {
    push(@links, $cgi->a({ -href => &read_config_option("controller_url") }, "Apex Controller"));
}

push(@links, $cgi->a({ -href => "tankstats.cgi" },  "Water Statistics"));
push(@links, $cgi->a({ -href => "notes.cgi" },      "Log/Notes"));
push(@links, $cgi->a({ -href => "graphindex.cgi" }, "Graphs"));
push(@links, $cgi->a({ -href => "history.cgi" },    "Combined History Table"));
push(@links, $cgi->a({ -href => "config/" },        "Configuration"));

# Web Page output
&ts_pagestart($pagetitle);
print $cgi->ul($cgi->li([@links]));
print $cgi->end_html;
print "\n";

# Okay, we're done, exit now.
exit 0;

